package main

import (
	"fmt"
	"net/http"
	"yigin/router"
	"yigin/public/setting"
)

func main(){
	fmt.Println(setting.ENV)
	router := router.InitRouter()
	s := &http.Server{
		Addr:           fmt.Sprintf(":%d", setting.BaseSetting.Http.Addr),
		Handler:        router,
		ReadTimeout:    setting.BaseSetting.Http.ReadTimeout,
		WriteTimeout:   setting.BaseSetting.Http.WriteTimeout,
		MaxHeaderBytes: 1 << 20,
	}

	if err := s.ListenAndServe(); err != nil {
			panic(err.Error())
	}
}